$m(function (args) {
    var $this = this.element;
    var form = $this.find('.tempo-node-property-form');
    var parameters = "[]";
    // 如果有则获取，没有就从页面获取
    if (args.parameters) {
        parameters = decodeURI(decodeURI(args.parameters));
    } else {
        parameters = $this.find('#parameters').val();
    }
    var parse = JSON.parse(parameters);

    var initPage = function () {
        TempoUtils.parserUi(form, {}, function (name, value) {
        });
        //获取表单中的列选择组件
        var columnSelectMutuals = form.find(".tempo-column-select-mutal");
        //遍历类选择组件 初始化
        for (var i = 0; i < columnSelectMutuals.length; i++) {
            var columnSelectMutual = $(columnSelectMutuals[i]);
            //获取列选择组件名称 初始化到列选择组件当中
            var columnSelectName = columnSelectMutual.parent().prev().children().text();
            columnSelectMutual.columnselectmutual({
                sourceData: JSON.parse($this.find('#sourceData').val()),
                inputValue: "",
                inputWidth: 450,
                enableSettingButton: true,
                dataList: [],
                defaultValue: "",
                formEditable: true,
                //列选择组件名称赋值
                columnSelectName: columnSelectName,
            });
        }
        columnSelectMutuals.find(".tempo-ui-icon-setting").css("margin-top", "4px");
        //开启预览的列选择编辑框
        // form.find(".tempo-column-select-mutal").find("a").css("pointer-events", "none");
    }

    /**
     * 初始化radio和check组件
     */
    var initCheckBoxAndRadio = function () {
        for (var i = 0; i < parse.length; i++) {
            var type = parse[i].type;
            var values = parse[i].values;
            var defaultValue = parse[i].defaultValue;
            var code = parse[i].code;
            if (type == "radio") {
                for (var j = 0; j < values.length; j++) {
                    var value = values[j].value;
                    if (value == defaultValue) {
                        form.find("input[name=" + code + "][value=" + value + "]").prop("checked", true);
                    }
                }
            } else if (type == "checkbox") {
                var strings = defaultValue.toString().split(",");
                for (var j = 0; j < values.length; j++) {
                    var value = values[j].value;
                    for (var k = 0; k < strings.length; k++) {
                        if (value == strings[k]) {
                            form.find("input[name=" + code + "][value=" + value + "]").prop("checked", true);
                        }
                    }
                }
            }
        }
    };

    var init = function () {
        /**
         * 初始化页面
         */
        initPage();
        /**
         * 给checkBox和radio赋默认值
         */
        initCheckBoxAndRadio();
    };

    init();

});





